<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
	<meta name="decorator" content="moduleEdit" />
	<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
	<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
	<link href="${staticPath}/lib/chosen/1.1.0/chosen.min.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
	<script type="text/javascript">
		$(document).ready(function() {
			$("#brandPicForm").validate({
				submitHandler: function(form){
					Oosp_Loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
			//单选对话框
			var shopDialog = {
					service: "selectOneShopService",
					idField: "shopNo",
					nameField: "shopName",
					title: "门店选择对话框"
			};
			$("#shopDialog").Dialog(shopDialog);
		});
		
		function openWin(url){
			var returnValue = openTempleteSelector(url,600,550);
			$("#brandCateId").val(returnValue.brandCateId);
			$("#brandNo").val(returnValue.brandNo);
			$("#brandInfo").val(returnValue.brandInfo);
		}
	</script>
</head>
<body>
<div class="Report_f">
           <div class="Report_f_1">
                <div class="Report_f_title_1">品牌责任人</div>
                <ul class="nav nav-tabs Report_f_title_2">
                    <li><a href="#label_1" data-toggle="tab">基本信息</a></li>
                  </ul>
<!-- Tab panes -->
                  <div class="tab-content Report_f_title_3">
                    <div class="tab-pane active" id="label_1">
                         <div class="Report_f_title_4">
                           <form:form id="brandPicForm" modelAttribute="brandPic" action="${contextPath}/biz/brand/pic/save" method="post" class="form-inline" role="form">
                          	<form:hidden path="id"/>
							<form:hidden path="brandNo"/>
							<tags:message content="${message}"/>
							<div class="f_2">	
							 <div class="form-group col-sm-6">
								<label for="shopName" class="col-sm-3 control-label f_4">门店:</label>
								<div class="col-sm-9 f_6">
									<div class="input-group">
									     <input id="shopName" name="shopName" value="${brandPic.shopName }"  maxlength="200" readonly="readonly" class="f_5" />
										 <form:hidden path="shopNo"/>
									      <span class="input-group-btn">
									        <button class="btn btn-default btn_3" id="shopDialog" type="button">
									        	选择
									        </button>
									      </span>
									 </div>
							    </div>
							</div>
							 <div class="form-group col-sm-6">
								<label for="brandInfo" class="col-sm-3 control-label f_4">品牌:</label>
								<div class="col-sm-9 f_6">
									<div class="input-group">
									 		<c:choose>
												<c:when test="${brandPic.id != null}">
													<input id="brandInfo" name="brandInfo" value="${brandPic.brandCname}(${brandPic.brandNo})/${brandPic.cateName}" readonly="readonly" class="f_5 required"/>
												</c:when>
												<c:otherwise>
													<input id="brandInfo" name="brandInfo" readonly="readonly" class="f_5 required"/>
												</c:otherwise>
											</c:choose>
										<span class="input-group-btn">
										<a  class="btn btn-default btn_3" href="#" onclick="openWin('${contextPath}/biz/brand/brandcate/dialoglist')">选择</a>
										</span>
								    </div>
							    </div>
							</div>
						</div>
						<div class="f_2">	
							 <div class="form-group col-sm-6">
								<label for="purchasePic" class="col-sm-3 control-label f_4">采购责任人:</label>
								<div class="col-sm-9 f_6">
									<form:hidden path="purchasePic"/> 
									<div class="input-group">
								      <input type="text" class="f_5" id="ppicName" value="${brandPic.purchasePicName }" readonly="readonly">
								      <span class="input-group-btn">
								        <button class="btn btn-default btn_3" id="p_userDialogMultiple" data-dialog="dialog" data-multiple="true" data-idField="purchasePic" data-nameField="ppicName" data-authType="USER" type="button">
								        	选择
								        </button>
								      </span>
								    </div>
							    </div>
							</div>
							 <div class="form-group col-sm-6">
								<label for="officerPic" class="col-sm-3 control-label f_4">营运责任人:</label>
								<div class="col-sm-9 f_6">
									<form:hidden path="officerPic"/> 
									<div class="input-group">
								      <input type="text" class="f_5" id="opicName" value="${brandPic.officerPicName }" readonly="readonly">
								      <span class="input-group-btn">
								        <button class="btn btn-default btn_3" id="o_userDialogMultiple" data-dialog="dialog" data-multiple="true" data-idField="officerPic" data-nameField="opicName" data-authType="USER" type="button">
								        	选择
								        </button>
								      </span>
								    </div>
							    </div>
							</div>
						</div>
                             <div class="f_12">
                                <button type="button" class="btn btn-danger btn_5 btn_right" onclick="history.go(-1)">返&nbsp;回</button>
                                <button type="submit" class="btn btn-success btn_5 btn_right">保&nbsp;存</button>
                           </div>
                      </form:form>
                 </div>
            </div>
	  </div>
	</div>	
</div>
<script type="text/javascript" src="${staticPath}/js/list.js"></script>
<script type="text/javascript" src="${staticPath}/js/brand.js"></script>
</body>
</html>